<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>滴答办公系统-我的信息</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		  content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="media/layui/css/layui.css" media="all">
	<link type="text/css" rel="stylesheet" href="/media/toastr/toastr.min.css">
	<script src="/media/js/jquery.min.js"></script>
	<script type="text/javascript" src="/media/toastr/toastr.min.js"></script>
</head>
<body>
<div class="layui-container" style="margin-top: 5px">
	<form class="layui-form" action="studentadd.do" method="post">
		<div class="layui-form-item">
			<label class="layui-form-label">姓名</label>
			<div class="layui-input-block">
				<div class="layui-form-mid layui-word-aux" id="username">小王</div>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label">头像</label>
			<div class="layui-input-block">
				<div class="layui-form-mid layui-word-aux">
					<img style="width: 150px; height: 150px" id="images" src="media/images/photo.jpg" />
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label" style="width: 100px;">上次登录时间</label>
			<div class="layui-input-inline">
				<div class="layui-form-mid layui-word-aux" id="loginTime">2010-10-01 23:23:23</div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">状态</label>
			<div class="layui-input-inline">
				<div class="layui-form-mid layui-word-aux" id="flag">启用</div>
			</div>
		</div>
	</form>
</div>


<script src="media/layui/layui.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
	var form;
	layui.use(
			[ 'form','upload', 'layedit', 'laydate' ],
			function() {
				form = layui.form, layer = layui.layer, layedit = layui.layedit, laydate = layui.laydate;
				var upload = layui.upload;
				//日期
				laydate.render({
					elem : '#date1'
				});
				laydate.render({
					elem : '#date2'
				});
				initData();
			});


	$.ajax({
		url:"/getUserInfo",
		datatype:"json",
		success:function (data) {
			var i = JSON.parse(data);
			var c = "";
			if (i.flag == 1){
			    c = "启用";
            }else {
			    c = "禁用";
            }
			$("#flag").text(c);
			$("#username").text(i.name);
			$("#loginTime").text(i.loginTime)
            $("#images").attr("src","/media/images/"+i.photo);

		}
	})
</script>
</body>
</html>